<extend name="Usercenter/index"/>

<block name="main">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">我的订单</li>
            <li>待付款</li>
            <li>待发货</li>
            <li>待收货</li>
            <li>交易完成</li>
        </ul>
        <div class="layui-tab-content">
            <!--我的订单-->
            <div class="layui-tab-item layui-show">

                   <div class="tr non-info show border-bottom-none">
                            <table class="layui-table">
                                <colgroup>
                                    <col width="400">
                                    <col width="100">
                                    <col width="100">
                                    <col width="100">
                                    <col>
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th>商品名</th>
                                        <th>图片</th>
                                        <th>数量</th>
                                        <th>价格</th>
                                        <th>状态</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <foreach name="orderList" item="item">
                                    <tr>
                                        <td colspan="5">订单号:{{$item.order_id}}</td>
                                    </tr>
                                    <foreach name="orderDetailList" item="value">
                                        <foreach name="value" item="val">
                                            <if condition="$item['order_id'] eq $val['order_id']">
                                                <tr>
                                                    <td>
                                                        <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                            {{$val.name}}
                                                        </a>
                                                    </td>
                                                    <td>
                                                        <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                            <img src="{{:get_img_url('__ROOT__/Uploads/GoodsImg/',$val['img'],50)}}">
                                                        </a>
                                                    </td>
                                                    <td>{{$val.num}}</td>
                                                    <td>{{$val.price}}</td>
                                                    <td>
                                                        {{$item['is_pay'] == 0 ?"未付款":"已付款"}}
                                                        <br>
                                                        {{$item['is_deliver'] == 0 ?"未发货":"已发货"}}
                                                        <br>
                                                        <eq name="item.is_pay" value="1">
                                                            <eq name="item.is_deliver" value="2">
                                                                <eq name="val.is_evaluate" value="0">
                                                                    <a href="{{:U('Usercenter/addeva',array('goods_id'=>$val['id'],'order_id'=>$item['order_id']))}}" style="color: #00a0df">去评价</a>
                                                                <else/>
                                                                    已评价
                                                                </eq>
                                                            </eq>
                                                        </eq>
                                                    </td>
                                                </tr>
                                            </if>
                                        </foreach>
                                    </foreach>
                                    <tr>
                                        <td colspan="4"></td>
                                        <td colspan="1">
                                            <if condition="$item['is_pay'] eq 0">
                                                <a href="{{:U('Usercenter/pay',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-danger">付款</a>
                                            <else/>
                                                <switch name="item.is_deliver">
                                                    <case value="0">
                                                        <a class="layui-btn layui-btn-warm">未发货</a>
                                                    </case>
                                                    <case value="1">
                                                        <a href="{{:U('Usercenter/receiveGood',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-info">确认收货</a>
                                                    </case>
                                                    <case value="2">
                                                        <a class="layui-btn layui-btn-normal">交易完成</a>

                                                        </eq>
                                                    </case>
                                                </switch>
                                            </if>

                                        </td>
                                    </tr>
                                </foreach>


                                </tbody>
                            </table>
                        </div>

            </div>
            <!--代付款-->
            <div class="layui-tab-item">

                <div class="tr non-info show border-bottom-none">
                    <table class="layui-table">
                        <colgroup>
                            <col width="400">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>商品名</th>
                            <th>图片</th>
                            <th>数量</th>
                            <th>价格</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="orderList" item="item">
                            <eq name="item.is_pay" value="0">
                                <tr>
                                    <td colspan="5">订单号:{{$item.order_id}}</td>
                                </tr>
                                <foreach name="orderDetailList" item="value">
                                    <foreach name="value" item="val">
                                        <if condition="$item['order_id'] eq $val['order_id']">
                                            <tr>
                                                <td>
                                                    <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                        {{$val.name}}
                                                    </a>
                                                </td>
                                                <td>
                                                    <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                        <img src="{{:get_img_url('__ROOT__/Uploads/GoodsImg/',$val['img'],50)}}">
                                                    </a>
                                                </td>
                                                <td>{{$val.num}}</td>
                                                <td>{{$val.price}}</td>
                                                <td>
                                                    {{$item['is_pay'] == 0 ?"未付款":"已付款"}}
                                                    <br>
                                                    {{$item['is_deliver'] == 0 ?"未发货":"已发货"}}
                                                    <br>
                                                    <eq name="item.is_pay" value="1">
                                                        <eq name="item.is_deliver" value="2">
                                                            <eq name="val.is_evaluate" value="0">
                                                                <a href="{{:U('Usercenter/addeva',array('goods_id'=>$val['id'],'order_id'=>$item['order_id']))}}" style="color: #00a0df">去评价</a>
                                                                <else/>
                                                                已评价
                                                            </eq>
                                                        </eq>
                                                    </eq>

                                                </td>
                                            </tr>
                                        </if>
                                    </foreach>
                                </foreach>
                                <tr>
                                    <td colspan="4"></td>
                                    <td colspan="1">
                                        <if condition="$item['is_pay'] eq 0">
                                            <a href="{{:U('Usercenter/pay',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-danger">付款</a>
                                            <else/>
                                            <switch name="item.is_deliver">
                                                <case value="0">
                                                    <a class="layui-btn layui-btn-warm">未发货</a>
                                                </case>
                                                <case value="1">
                                                    <a href="{{:U('Usercenter/receiveGood',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-info">确认收货</a>
                                                </case>
                                                <case value="2">
                                                    <a class="layui-btn layui-btn-normal">交易完成</a>
                                                </case>
                                            </switch>
                                        </if>

                                    </td>
                                </tr>
                            </eq>
                        </foreach>


                        </tbody>
                    </table>
                </div>

            </div>
            <!--待发货-->
            <div class="layui-tab-item">
                <div class="tr non-info show border-bottom-none">
                    <table class="layui-table">
                        <colgroup>
                            <col width="400">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>商品名</th>
                            <th>图片</th>
                            <th>数量</th>
                            <th>价格</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="orderList" item="item">
                            <eq name="item.is_pay" value="1">
                                <eq name="item.is_deliver" value="0">
                                    <tr>
                                        <td colspan="5">订单号:{{$item.order_id}}</td>
                                    </tr>
                                    <foreach name="orderDetailList" item="value">
                                        <foreach name="value" item="val">
                                            <if condition="$item['order_id'] eq $val['order_id']">
                                                <tr>
                                                    <td>
                                                        <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                            {{$val.name}}
                                                        </a>
                                                    </td>
                                                    <td>
                                                        <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                            <img src="{{:get_img_url('__ROOT__/Uploads/GoodsImg/',$val['img'],50)}}">
                                                        </a>
                                                    </td>
                                                    <td>{{$val.num}}</td>
                                                    <td>{{$val.price}}</td>
                                                    <td>
                                                        {{$item['is_pay'] == 0 ?"未付款":"已付款"}}
                                                        <br>
                                                        {{$item['is_deliver'] == 0 ?"未发货":"已发货"}}
                                                        <br>
                                                        <eq name="item.is_pay" value="1">
                                                            <eq name="item.is_deliver" value="2">
                                                                <eq name="val.is_evaluate" value="0">
                                                                    <a href="{{:U('Usercenter/addeva',array('goods_id'=>$val['id'],'order_id'=>$item['order_id']))}}" style="color: #00a0df">去评价</a>
                                                                    <else/>
                                                                    已评价
                                                                </eq>
                                                            </eq>
                                                        </eq>
                                                    </td>
                                                </tr>
                                            </if>
                                        </foreach>
                                    </foreach>
                                    <tr>
                                        <td colspan="4"></td>
                                        <td colspan="1">
                                            <if condition="$item['is_pay'] eq 0">
                                                <a href="{{:U('Usercenter/pay',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-danger">付款</a>
                                                <else/>
                                                <switch name="item.is_deliver">
                                                    <case value="0">
                                                        <a class="layui-btn layui-btn-warm">未发货</a>
                                                    </case>
                                                    <case value="1">
                                                        <a href="{{:U('Usercenter/receiveGood',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-info">确认收货</a>
                                                    </case>
                                                    <case value="2">
                                                        <a class="layui-btn layui-btn-normal">交易完成</a>
                                                    </case>
                                                </switch>
                                            </if>

                                        </td>
                                    </tr>
                                </eq>
                            </eq>
                        </foreach>


                        </tbody>
                    </table>
                </div>

            </div>
            <!--待收货-->
            <div class="layui-tab-item">
                <div class="tr non-info show border-bottom-none">
                    <table class="layui-table">
                        <colgroup>
                            <col width="400">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>商品名</th>
                            <th>图片</th>
                            <th>数量</th>
                            <th>价格</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="orderList" item="item">
                            <eq name="item.is_pay" value="1">
                                <eq name="item.is_deliver" value="1">
                                    <tr>
                                        <td colspan="5">订单号:{{$item.order_id}}</td>
                                    </tr>
                                    <foreach name="orderDetailList" item="value">
                                        <foreach name="value" item="val">
                                            <if condition="$item['order_id'] eq $val['order_id']">
                                                <tr>
                                                    <td>
                                                        <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                            {{$val.name}}
                                                        </a>
                                                    </td>
                                                    <td>
                                                        <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                            <img src="{{:get_img_url('__ROOT__/Uploads/GoodsImg/',$val['img'],50)}}">
                                                        </a>
                                                    </td>
                                                    <td>{{$val.num}}</td>
                                                    <td>{{$val.price}}</td>
                                                    <td>
                                                        {{$item['is_pay'] == 0 ?"未付款":"已付款"}}
                                                        <br>
                                                        {{$item['is_deliver'] == 0 ?"未发货":"已发货"}}
                                                        <br>
                                                        <eq name="item.is_pay" value="1">
                                                            <eq name="item.is_deliver" value="2">
                                                                <eq name="val.is_evaluate" value="0">
                                                                    <a href="{{:U('Usercenter/addeva',array('goods_id'=>$val['id'],'order_id'=>$item['order_id']))}}" style="color: #00a0df">去评价</a>
                                                                    <else/>
                                                                    已评价
                                                                </eq>
                                                            </eq>
                                                        </eq>
                                                    </td>
                                                </tr>
                                            </if>
                                        </foreach>
                                    </foreach>
                                    <tr>
                                        <td colspan="4"></td>
                                        <td colspan="1">
                                            <if condition="$item['is_pay'] eq 0">
                                                <a href="{{:U('Usercenter/pay',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-danger">付款</a>
                                                <else/>
                                                <switch name="item.is_deliver">
                                                    <case value="0">
                                                        <a class="layui-btn layui-btn-warm">未发货</a>
                                                    </case>
                                                    <case value="1">
                                                        <a href="{{:U('Usercenter/receiveGood',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-info">确认收货</a>
                                                    </case>
                                                    <case value="2">
                                                        <a class="layui-btn layui-btn-normal">交易完成</a>
                                                    </case>
                                                </switch>
                                            </if>

                                        </td>
                                    </tr>
                                </eq>
                            </eq>
                        </foreach>


                        </tbody>
                    </table>
                </div>

            </div>
            <!--交易完成-->
            <div class="layui-tab-item">
                <div class="tr non-info show border-bottom-none">
                    <table class="layui-table">
                        <colgroup>
                            <col width="400">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>商品名</th>
                            <th>图片</th>
                            <th>数量</th>
                            <th>价格</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="orderList" item="item">
                            <eq name="item.is_pay" value="1">
                                <eq name="item.is_deliver" value="2">
                                    <tr>
                                        <td colspan="5">订单号:{{$item.order_id}}</td>
                                    </tr>
                                    <foreach name="orderDetailList" item="value">
                                        <foreach name="value" item="val">
                                            <if condition="$item['order_id'] eq $val['order_id']">
                                                <tr>
                                                    <td>
                                                        <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                            {{$val.name}}
                                                        </a>
                                                    </td>
                                                    <td>
                                                        <a href="{{:U('Index/goodsDetails',array('id'=>$val['id']))}}">
                                                            <img src="{{:get_img_url('__ROOT__/Uploads/GoodsImg/',$val['img'],50)}}">
                                                        </a>
                                                    </td>
                                                    <td>{{$val.num}}</td>
                                                    <td>{{$val.price}}</td>
                                                    <td>
                                                        {{$item['is_pay'] == 0 ?"未付款":"已付款"}}
                                                        <br>
                                                        {{$item['is_deliver'] == 0 ?"未发货":"已发货"}}
                                                        <br>
                                                        <eq name="item.is_pay" value="1">
                                                            <eq name="item.is_deliver" value="2">
                                                                <eq name="val.is_evaluate" value="0">
                                                                    <a href="{{:U('Usercenter/addeva',array('goods_id'=>$val['id'],'order_id'=>$item['order_id']))}}" style="color: #00a0df">去评价</a>
                                                                    <else/>
                                                                    已评价
                                                                </eq>
                                                            </eq>
                                                        </eq>
                                                    </td>
                                                </tr>
                                            </if>
                                        </foreach>
                                    </foreach>
                                    <tr>
                                        <td colspan="4"></td>
                                        <td colspan="1">
                                            <if condition="$item['is_pay'] eq 0">
                                                <a href="{{:U('Usercenter/pay',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-danger">付款</a>
                                                <else/>
                                                <switch name="item.is_deliver">
                                                    <case value="0">
                                                        <a class="layui-btn layui-btn-warm">未发货</a>
                                                    </case>
                                                    <case value="1">
                                                        <a href="{{:U('Usercenter/receiveGood',array('order_id'=>$item['order_id']))}}" class="layui-btn layui-btn-info">确认收货</a>
                                                    </case>
                                                    <case value="2">
                                                        <a class="layui-btn layui-btn-normal">交易完成</a>
                                                    </case>
                                                </switch>
                                            </if>

                                        </td>
                                    </tr>
                                </eq>
                            </eq>
                        </foreach>


                        </tbody>
                    </table>
                </div>

            </div>

        </div>
        <script>
            //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
            layui.use('element', function(){
                var element = layui.element;
            });
        </script>
    </div>



    <!--<div class="stamp stamp04">-->
    <!--<div class="par"><p>XXXXXX折扣店</p><sub class="sign">￥</sub><span>50.00</span><sub>优惠券</sub><p>订单满100.00元</p></div>-->
    <!--<div class="copy">副券<p>2015-08-13<br>2016-08-13</p><a href="#">立即使用</a></div>-->
    <!--<i></i>-->
    <!--</div>-->






</block>